<template>
	<view style="padding-top: 100rpx;">
		<view class="text-area">
			<text>输入值：</text><input type="text" v-model="title" style="color: palevioletred;" />
		</view>
		<view class="text-area">
			<text>回传值：</text><input type="text" :value="callBackValue" style="color:lightskyblue;" />
		</view>
		<comA :intent="title"></comA>
		<comB @callBackFun="callback"></comB>
	</view>
</template>

<script>
	import ComAVue from '../../components11/ComA.vue';
	import ComBVue from '../../components11/ComB.vue';
	
	export default {
		components: {
			comA: ComAVue,
			comB: ComBVue
		},
		data() {
			return {
				title: '', 
				callBackValue: '' 
			}
		},
		methods: {
			// 子组件B回传值的回调方法
			callback(msg) {
				console.warn("---父组件接收回传值--->" + msg);
				this.callBackValue = msg;
			}
		}
	}
</script>

<style>
	/* 可选：补充样式优化显示 */
	.text-area {
		margin: 20rpx;
		display: flex;
		align-items: center;
	}
	input {
		border: 1px solid #eee;
		padding: 10rpx;
		margin-left: 10rpx;
		flex: 1;
		border-radius: 8rpx;
	}
</style>